ass Solution {
public:
    string reverseWords(string s) {
        size_t begin=0;
        size_t end = s.find(' ');
        //"Let's take LeetCode contest"
        //     pos
        while(end!=string::npos)
        {
            reverse(s.begin()+begin,s.begin()+end);
            begin=end+1;
            end = s.find(' ',begin+1);
        }
        begin = s.rfind(' ');
        reverse(s.begin()+begin+1,s.end());
        return s;
    }
};


class Solution {
public:
    int maxPower(string s) {
        size_t max=1;
        size_t sum=1;
        char prev=s[0];
        size_t cur=1;//char cur
        while(cur<s.size())
        {
            if(s[cur]==prev)
            {
                sum++;
                if(sum>max)
                    max=sum;
            }
            else
            {
                prev = s[cur];
                sum=1;
            }
            cur++;
        }
        return max;
    }
};
